function logger(options) {
    return async (ctx, next) => {
        process.stdout.write(`\x1B[42m[${utils.datetimeFormat()} ${ctx.request.method.toUpperCase()}]\x1B[49m `);
        process.stdout.write(`\x1B[36m${ctx.request.url}\x1b[0m`);
        process.stdout.write(`\x1B[33m header:${JSON.stringify(ctx.request.header)}\x1b[0m`);
        process.stdout.write(`\x1B[90m body: ${JSON.stringify(ctx.request.body)}\x1B[39m`);
        console.log();
        await next();
    }
}


module.exports = logger;